function test(result,shouldBe)
{
    if(shouldBe==-1)
    {
	document.getElementById('result').innerHTML+="<strong class='blue'>VIEW</strong>:\n"+result+"\n";
	return;
    }
    if(shouldBe==-2)
    {
	document.getElementById('result').innerHTML+="\n<strong class='green'>Action</strong>:"+result+"\n";
	return;
    }
    if(result!=shouldBe)
    {
	document.getElementById('result').innerHTML+="<strong class='red'>ERROR</strong>:\n"+
	    "result should be "+shouldBe+"\n"+
	    "but it is "+result+"\n";
    }
    else
    {
	document.getElementById('result').innerHTML+="<div class='green'>Pass.</div>\n";
    }
}

